home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Supervisor's Toolkit
/
Network Supervisor's Toolkit.iso
/
tools
/
lu62
/
proc
/
fdetach.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-07-10
|
1KB
|
57 lines
/*
* CopyRight 1995. Nicholas Poljakov all rights reserved.
*/
#include <malloc.h>
#include <stdio.h>
#include <detach.h>
#include <state1.h>
#include <dos.h>
detach_lu (lu_id,rc)
unsigned char lu_id[8];
unsigned long *rc;
{
union REGS inregs,outregs;
struct SREGS segregs;
struct detach *ptr;
char _near *dp1;
char _near *dp2;
int i,l;
l = sizeof(struct detach);
if ((ptr = (char *)calloc(1,l)) == NULL)
{
*rc = PORT_BUSY;
return(0);
}
ptr->verb_cd=Detach_lu;
memcpy (ptr->lu_id,lu_id,8);
/*
inregs.x.dx = FP_OFF(ptr);
segregs.ds = FP_SEG(ptr);
inregs.x.ax = ptr->verb_cd;
int86x(0x68,&inregs,&outregs,&segregs);
*/
dp1 = FP_OFF( ptr );
dp2 = FP_SEG( ptr );
_asm
{
push ds
mov dx, word ptr dp1[0]
mov ax, word ptr dp2[0]
mov ds, ax
mov ax, Detach_lu
int 68h
pop ds
}
*rc = ptr->rc;
free(ptr);
return(0);
}